function removeZero(arr) {
    let zIndex = 0;
    for (let i = 0; i < arr.length; i++) {
        if (arr[i] !== 0) {
            [arr[i], arr[zIndex]] = [arr[zIndex], arr[i]]
            zIndex++
        }
    }
    return arr
}

console.log(removeZero([0,0,0,1,2,3]))